{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
   <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
          <section class="col-lg-2 connectedSortable" style=" padding-right:0px;">
            <div>
                <a href="index.php?a=resource.list" class="btn btn-default">教学资源</a>
                <a href="index.php?a=resource.favlist" class="btn btn-success">我的收藏</a>
            </div>
         <div class="sidebar" style="background-color:#fff; padding-bottom:0px; border:1px solid #ddd; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);">
				 <ul class="sidebar-menu" id="chan">
						<li class="treeview">
							<a href="index.php?a=resource.classifyList">
								<i class="fa fa-list"></i>分类设置
							</a>
						</li>
						{%foreach from=$grade key=key item=value%}
							<li class="treeview {%if $grade_id==$key%}active{%/if%}">
							  <a href="#">
								<i class="glyphicon glyphicon-align-left"></i> <span>{%$value.grade_name%}</span> 
								<i class="fa fa-angle-left pull-right">
								</i>
							  </a>
								  <ul class="treeview-menu" style="background-color:#fff;">
								  {%foreach from=$value.subject key=k item=v%}
									<li  {%if $subject_id==$k%}class="active"{%/if%}>
										<a href="index.php?a=resource.list&grade_id={%$key%}&subject_id={%$ka%}">
											<i class="fa fa-angle-right"></i>{%$v%}
										</a>
									</li>
									{%/foreach%}
								  </ul>
							</li>
						{%/foreach%}
				  </ul>
				</div>
        </section>
        <!--树状图结束-->
        <section class="col-lg-10 connectedSortable">
         <div class="box box-default box-solid">
             <form name="myform" action="" method="get">	
                <div class="box-header with-border">
                    <span class="fa fa-pagelines" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">我的收藏</p>
					
                </div>
                <div class="box-body">	
                    <div class="form-group" style="margin-bottom:5px;">
                       <a href="index.php?a=resource.favlist" class="btn btn-success btn-sm">全部分类</a>
					 {%foreach from=$part_lists key=key item=value%}
                       <a href="index.php?a=resource.favlist&part_id={%$value.part_id%}" {%if $value.part_id == $part_id%}class="stuffs"{%else%}class="stuff"{%/if%}>{%$value.part_name%}</a>
                     {%/foreach%}
                    </div>
                    <div class="form-group" style="margin-bottom:20px;">
                       <a href="index.php?a=resource.favlist" class="btn btn-success btn-sm">全部格式</a>
                       <a href="index.php?a=resource.favlist&file_type=doc&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">DOC</a>
                       <a href="index.php?a=resource.favlist&file_type=xls&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">XLS</a>
                       <a href="index.php?a=resource.favlist&file_type=ppt&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">PPT</a>
                       <a href="index.php?a=resource.favlist&file_type=pdf&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">PDF</a>
                       <a href="index.php?a=resource.favlist&file_type=txt&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">TXT</a>
                       <a href="index.php?a=resource.favlist&file_type=mp4&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">视频</a>
                       <a href="index.php?a=resource.favlist&file_type=qi&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="stuff">其他</a>
                    </div>
                    <div class="col-md-3 form-group" style="padding:0;">
						  <label for="inputPassword3" class="col-sm-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   标题：
						  </label>
						  <div class="input-group col-md-9 col-xs-12">
							   <input type="text" class="form-control" name="resource_title" value="{%$resource_title%}">
						  </div> 
				    </div>
					<div class="col-md-2 form-group" style="padding:0;">
						  <label for="inputPassword3" class="col-sm-6 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   上传人：
						  </label>
						  <div class="input-group col-md-6 col-xs-12">
							    <input type="text" class="form-control" name="staff_names" value="{%$staff_names%}">
						  </div> 
				    </div>
					<div class="col-md-7 col-xs-12 form-group" style="padding:0;">
						  <label  class="col-sm-2 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; ">
							   时间：
						  </label>
						  <div class="input-group col-md-4" style="float:left;">
							   <input type="text" class="form-control" value="{%$from%}" id="from" name="from">
							     <div class="input-group-addon" style="padding:6px 7px;">
									<i class="fa fa-calendar"></i>
								 </div>
						  </div>
						  <span style="float:left;">  ~  </span >
						  <div class="input-group col-md-4" style="float:left; margin-right:8px;">
							   <input type="text" class="form-control" value="{%$to%}" id="to" name="to">
							      <div class="input-group-addon" style="padding:6px 7px;">
									 <i class="fa fa-calendar"></i>
								 </div>
						  </div>
					   <input type="hidden" name="grade_id" value="{%$grade_id%}">
					   <input type="hidden" name="subject_id" value="{%$subject_id%}">
				       <input type="hidden" name="a" value="resource.favlist">
					   <button type="submit" class="btn btn-warning btn-sm">查 询</button>
					</div>
					<div style="clear:both; height:10px;"></div>
                     <table class="table table-bordered table-striped"  id="mytable">
                                <thead>
                                    <tr style="background-color:#fcb53f;">
                                        <td>标题</td>
                                        <td>分类</td>
                                        <td>格式</td>
                                        <td>上传人</td>
                                        <td>大小
                                           <i class="fa fa-sort-amount-asc"></i><i class="fa fa-sort-amount-desc"></i>
                                         </td>
                                        <td>上传时间</td>
                                         
                                        <td width="160">操作</td>
                                    </tr>	
                                </thead>
                                <tbody>
								{%foreach from=$resource_lists key=key item=value%}
                                    <tr>
                                        <td>{%$value.resource_title%}</td>
                                        <td>{%$value.part_name%}</td>
                                        <td>{%$value.file_type%}</td>
                                        <td>{%$value.staff_name%}</td>
                                        <td>{%$value.file_size%}</td>
                                        <td>{%$value.create_time%}</td>
                                        
										<td>
                                            <a href="index.php?a=resource.details&resource_id={%$value.resource_id%}&grade_id={%$grade_id%}&subject_id={%$subject_id%}&resource_type=shouchang" class="btn btn-success btn-xs" title="查看"><i class="fa fa-search"></i></a>
                                            <a href="index.php?a=resource.output&resource_file={%$value.resource_file%}&resource_id={%$value.resource_id%}" class="btn btn-primary btn-xs" title="下载"><i class="fa fa-download"></i></a>
                                            <a  href="index.php?a=resource.favdel&fav_id={%$value.fav.fav_id%}" class="btn btn-warning btn-xs" title="取消收藏"><i class="fa fa-star"></i></a>
                                            {%if $user_auth.user_id==$value.user_id%}
                                            <a href="index.php?a=resource.update&resource_id={%$value.resource_id%}&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="btn btn-info btn-xs" title="修改"><i class="fa fa-edit"></i></a>
                                            {%/if%}

                                            {%if $user_auth.user_id==$value.user_id%}
                                            <a href="index.php?a=resource.del&resource_id={%$value.resource_id%}&grade_id={%$grade_id%}&subject_id={%$subject_id%}" class="btn btn-danger btn-xs" onclick="if(confirm('警告！确认删除信息?')==false)return false;" title="删除"><i class="fa fa-trash"></i></a>
                                            {%/if%}
                                        </td>
                                     
                                    </tr>	
								{%/foreach%} 
                            </tbody>
                        </table>
				   </div><!--box-body -->
                   <div class="box-footer">
                      {%$page%}
                   </div>
               </form>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
 {%include file="index.footer.tpl.php"%}
<script>
  $(function() {
    $( "#from" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
	  changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#to" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    $( "#to" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
  </script>
 
 
